package test;



public class zsa {
    public boolean repeatedSubstringPattern(String s) {
        String  a = null;
        String  b = null;
        int n = s.length();
        for(int i = n/2; i>0; i--){
            if( (n%i) == 0 ){
                a = s.substring(0,i+1);
                for(int j =0 ; j <n/i ; j++){
                    b  = b + a;
                }
                if(b.equals(s)){
                    return true;
                }
            }

        }
        return false;
    }
    public void main(String[] args) {
       String s  ="abab";
        System.out.println(repeatedSubstringPattern(s));
    }
}
